package request

// CreateOrderFlatRequest 创建订单平级参数请求
type CreateOrderFlatRequest struct {
	OrderType      string `form:"order_type" json:"order_type" binding:"required"`             // 订单类型
	TenantID       string `form:"tenant_id" json:"tenant_id" binding:"required"`               // 租客ID
	LandlordID     string `form:"landlord_id" json:"landlord_id" binding:"required"`           // 房东ID
	PropertyID     string `form:"property_id" json:"property_id" binding:"required"`           // 物业ID
	AgentID        string `form:"agent_id" json:"agent_id"`                                    // 代理商ID
	LeaseStartDate string `form:"lease_start_date" json:"lease_start_date" binding:"required"` // 租赁开始日期
	LeaseEndDate   string `form:"lease_end_date" json:"lease_end_date" binding:"required"`     // 租赁结束日期
	Remark         string `form:"remark" json:"remark"`                                        // 备注
	// 订单明细字段（平级）
	ItemType         string `form:"item_type" json:"item_type" binding:"required"`   // 商品类型
	ItemName         string `form:"item_name" json:"item_name" binding:"required"`   // 商品名称
	ItemDesc         string `form:"item_desc" json:"item_desc"`                      // 商品描述
	UnitPrice        string `form:"unit_price" json:"unit_price" binding:"required"` // 单价
	Quantity         string `form:"quantity" json:"quantity" binding:"required"`     // 数量
	BillingCycle     string `form:"billing_cycle" json:"billing_cycle"`              // 计费周期
	BillingStartDate string `form:"billing_start_date" json:"billing_start_date"`    // 账单开始日期
	BillingEndDate   string `form:"billing_end_date" json:"billing_end_date"`        // 账单结束日期
}

// GetOrder 获取订单详情
type GetOrder struct {
	OrderID uint64 `json:"order_id" form:"order_id" binding:"required"` //订单ID
}

// GetOrdersByTenantRequest 获取租客订单列表请求
type GetOrdersByTenantRequest struct {
	TenantID string `form:"tenant_id" json:"tenant_id" binding:"required"` // 租客ID
	Page     int32  `form:"page" json:"page"`                              // 分页
	PageSize int32  `form:"page_size" json:"page_size"`                    // 分页大小
}

// GetOrdersByLandlordRequest 获取房东订单列表请求
type GetOrdersByLandlordRequest struct {
	LandlordID string `form:"landlord_id" json:"landlordID" binding:"required"` // 房东ID
	Page       int32  `form:"page" json:"page"`                                 // 分页
	PageSize   int32  `form:"page_size" json:"page_size"`                       // 分页大小
}

// OrderItemRequest 订单明细请求
type OrderItemRequest struct {
	ItemType         int32   `form:"item_type" json:"item_type" binding:"required" example:"1"`         // 商品类型
	ItemName         string  `form:"item_name" json:"item_name" binding:"required" example:"月租金"`       // 商品名称
	ItemDesc         string  `form:"item_desc" json:"item_desc" example:"每月租金费用"`                       // 商品描述
	UnitPrice        float64 `form:"unit_price" json:"unit_price" binding:"required" example:"2000.00"` // 单价
	Quantity         float64 `form:"quantity" json:"quantity" binding:"required" example:"1"`           // 数量
	BillingCycle     int32   `form:"billing_cycle" json:"billing_cycle" example:"1"`                    // 计费周期
	BillingStartDate string  `form:"billing_start_date" json:"billing_start_date" example:"2025-02-01"` // 账单开始日期
	BillingEndDate   string  `form:"billing_end_date" json:"billing_end_date" example:"2025-12-31"`     // 账单结束日期
}

// UpdateOrderStatusRequest 更新订单状态请求
type UpdateOrderStatusRequest struct {
	OrderID      uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                // 订单ID
	Status       int32  `form:"status" json:"status" binding:"required" example:"1"`                    // 状态
	OperatorID   string `form:"operator_id" json:"operator_id" binding:"required" example:"user_001"`   // 操作人ID
	OperatorType string `form:"operator_type" json:"operator_type" binding:"required" example:"tenant"` // 操作人类型
	Reason       string `form:"reason" json:"reason" example:"确认订单"`                                    // 原因
}

// CreatePaymentRequest 创建支付记录请求
type CreatePaymentRequest struct {
	OrderID        uint64  `form:"order_id" json:"order_id" binding:"required" example:"1"`               // 订单ID
	PaymentType    int32   `form:"payment_type" json:"payment_type" binding:"required" example:"1"`       // 支付类型
	PaymentMethod  int32   `form:"payment_method" json:"payment_method" binding:"required" example:"1"`   // 支付方式
	PaymentChannel int32   `form:"payment_channel" json:"payment_channel" binding:"required" example:"1"` // 支付渠道
	Amount         float64 `form:"amount" json:"amount" binding:"required" example:"2000.00"`             // 金额
	Remark         string  `form:"remark" json:"remark" example:"租金支付"`                                   // 备注
}

// ProcessPaymentRequest 处理支付请求
type ProcessPaymentRequest struct {
	OrderID       uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                   // 订单ID
	PaymentID     uint64 `form:"payment_id" json:"payment_id" binding:"required" example:"1"`               // 支付ID
	TransactionID string `form:"transaction_id" json:"transaction_id" binding:"required" example:"txn_001"` // 交易ID
	Status        int32  `form:"status" json:"status" binding:"required" example:"1"`                       // 状态
}

// CreateContractRequest 创建合同请求
type CreateContractRequest struct {
	OrderID         uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`           // 订单ID
	ContractType    int32  `form:"contract_type" json:"contract_type" binding:"required" example:"1"` // 合同类型
	ContractContent string `form:"contract_content" json:"contract_content" binding:"required"`       // 合同内容
}

// SignContractRequest 签署合同请求
type SignContractRequest struct {
	ContractID uint64 `form:"contract_id" json:"contract_id" binding:"required" example:"1"`    // 合同ID
	SignerID   string `form:"signer_id" json:"signer_id" binding:"required" example:"user_001"` // 签署人ID
	Signature  string `form:"signature" json:"signature" binding:"required"`                    // 签名
	SignerType int32  `form:"signer_type" json:"signer_type" binding:"required" example:"1"`    // 签署人类型
}

// CreateReviewRequest 创建评价请求
type CreateReviewRequest struct {
	OrderID             uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`              // 订单ID
	ReviewerID          string `form:"reviewer_id" json:"reviewer_id" binding:"required" example:"user_001"` // 评价人ID
	RevieweeID          string `form:"reviewee_id" json:"reviewee_id" binding:"required" example:"user_002"` // 被评价人ID
	ReviewType          int32  `form:"review_type" json:"review_type" binding:"required" example:"1"`        // 评价类型
	OverallRating       int32  `form:"overall_rating" json:"overall_rating" binding:"required" example:"5"`  // 总体评分
	ServiceRating       int32  `form:"service_rating" json:"service_rating" example:"5"`                     // 服务评分
	CommunicationRating int32  `form:"communication_rating" json:"communication_rating" example:"5"`         // 沟通评分
	CleanlinessRating   int32  `form:"cleanliness_rating" json:"cleanliness_rating" example:"5"`             // 清洁评分
	ValueRating         int32  `form:"value_rating" json:"value_rating" example:"5"`                         // 性价比评分
	Content             string `form:"content" json:"content" example:"服务很好"`                                // 评价内容
}

// CreateComplaintRequest 创建投诉请求
type CreateComplaintRequest struct {
	OrderID       uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                    // 订单ID
	ComplainantID string `form:"complainant_id" json:"complainant_id" binding:"required" example:"user_001"` // 投诉人ID
	RespondentID  string `form:"respondent_id" json:"respondent_id" binding:"required" example:"user_002"`   // 被投诉人ID
	ComplaintType int32  `form:"complaint_type" json:"complaint_type" binding:"required" example:"1"`        // 投诉类型
	Title         string `form:"title" json:"title" binding:"required" example:"房源问题"`                       // 投诉标题
	Content       string `form:"content" json:"content" binding:"required" example:"房源描述不符"`                 // 投诉内容
}

// DeleteOrder 删除订单
type DeleteOrder struct {
	OrderId int32 `json:"order_id" form:"order_id" binding:"required"` //订单ID
}

// GetOrderStatistics 获取订单统计
type GetOrderStatistics struct {
	TenantID   string `json:"tenant_id" form:"tenant_id" binding:"required"`     // 租客ID
	LandlordID string `json:"landlord_id" form:"landlord_id" binding:"required"` // 房东ID
	StartDate  string `json:"start_date" form:"start_date" binding:"required"`   // 开始时间
	EndDate    string `json:"end_date" form:"end_date" binding:"required"`       // 结束时间
}

// AcceptOrderRequest 接单请求
type AcceptOrderRequest struct {
	OrderID      uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                  // 订单ID
	OperatorID   int32  `form:"operator_id" json:"operator_id" binding:"required" example:"operator_001"` // 操作员ID
	OperatorType int32  `form:"operator_type" json:"operator_type" binding:"required" example:"operator"` // 操作员类型
	Reason       string `form:"reason" json:"reason" example:"接单处理"`                                      // 接单原因
}

// RejectOrderRequest 拒绝订单请求
type RejectOrderRequest struct {
	OrderID      uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                  // 订单ID
	OperatorID   string `form:"operator_id" json:"operator_id" binding:"required" example:"operator_001"` // 操作员ID
	OperatorType string `form:"operator_type" json:"operator_type" binding:"required" example:"operator"` // 操作员类型
	Reason       string `form:"reason" json:"reason" example:"拒绝接单"`                                      // 拒绝原因
}

// GetPendingOrdersRequest 获取待处理订单请求
type GetPendingOrdersRequest struct {
	Page       int32  `form:"page" json:"page" example:"1"`                          // 页码
	PageSize   int32  `form:"page_size" json:"page_size" example:"10"`               // 每页数量
	Status     int32  `form:"status" json:"status" example:"1"`                      // 订单状态
	OperatorID string `form:"operator_id" json:"operator_id" example:"operator_001"` // 操作员ID
}

// AssignOrderRequest 分配订单请求
type AssignOrderRequest struct {
	OrderID        uint64 `form:"order_id" json:"order_id" binding:"required" example:"1"`                  // 订单ID
	AssignedTo     string `form:"assigned_to" json:"assigned_to" binding:"required" example:"operator_002"` // 分配给谁
	AssignedBy     string `form:"assigned_by" json:"assigned_by" binding:"required" example:"admin_001"`    // 分配人
	AssignmentNote string `form:"assignment_note" json:"assignment_note" example:"分配给经验丰富的操作员"`             // 分配备注
}

// GetOrderAcceptanceStatsRequest 获取接单统计请求
type GetOrderAcceptanceStatsRequest struct {
	OperatorID string `form:"operator_id" json:"operator_id" example:"operator_001"` // 操作员ID
	StartDate  string `form:"start_date" json:"start_date" example:"2025-01-01"`     // 开始日期
	EndDate    string `form:"end_date" json:"end_date" example:"2025-01-31"`         // 结束日期
}

// BatchAcceptOrdersRequest 批量接单请求
type BatchAcceptOrdersRequest struct {
	OrderIDs     []uint64 `form:"order_ids" json:"order_ids" binding:"required" example:"[1,2,3]"`          // 订单ID列表
	OperatorID   int32    `form:"operator_id" json:"operator_id" binding:"required" example:"1"`            // 操作员ID
	OperatorType int32    `form:"operator_type" json:"operator_type" binding:"required" example:"1"`        // 操作员类型
	Reason       string   `form:"reason" json:"reason" example:"批量接单处理"`                                    // 接单原因
}

// BatchRejectOrdersRequest 批量拒绝订单请求
type BatchRejectOrdersRequest struct {
	OrderIDs     []uint64 `form:"order_ids" json:"order_ids" binding:"required" example:"[1,2,3]"`          // 订单ID列表
	OperatorID   int32    `form:"operator_id" json:"operator_id" binding:"required" example:"1"`            // 操作员ID
	OperatorType int32    `form:"operator_type" json:"operator_type" binding:"required" example:"1"`        // 操作员类型
	Reason       string   `form:"reason" json:"reason" example:"批量拒绝处理"`                                    // 拒绝原因
}
